#include <aarch64/mmu.h>

/**
 * The layout of physical memory space of virt:
 * 
 * 0..128MB is space for a flash device so we can run bootrom code such as UEFI.
 * 128MB..256MB is used for miscellaneous device I/O.
 * 256MB..1GB is reserved for possible future PCI support (ie where the
 * PCI memory window will go if we add a PCI host controller).
 * 1GB and up is RAM (which may happily spill over into the
 * high memory region beyond 4GB).
 * This represents a compromise between how much RAM can be given to
 * a 32 bit VM and leaving space for expansion and in particular for PCI.
 * Note that devices should generally be placed at multiples of 0x10000,
 * to accommodate guests using 64K pages.
 */

/**
 * Bits used to index: 29:21
 * Size per entry: 2MB
 * Address Span: [0x0, 0x40000000 (1GB)]
 */
__attribute__((__aligned__(PAGE_SIZE))) PTEntries _kernel_pt_lv2_dev = {
    // Space up to 0x8000000 is reserved for a boot ROM
    [0] = 0x0 & ~PTE_VALID,
    [1] = 0x200000 & ~PTE_VALID,
    [2] = 0x400000 & ~PTE_VALID,
    [3] = 0x600000 & ~PTE_VALID,
    [4] = 0x800000 & ~PTE_VALID,
    [5] = 0xa00000 & ~PTE_VALID,
    [6] = 0xc00000 & ~PTE_VALID,
    [7] = 0xe00000 & ~PTE_VALID,
    [8] = 0x1000000 & ~PTE_VALID,
    [9] = 0x1200000 & ~PTE_VALID,
    [10] = 0x1400000 & ~PTE_VALID,
    [11] = 0x1600000 & ~PTE_VALID,
    [12] = 0x1800000 & ~PTE_VALID,
    [13] = 0x1a00000 & ~PTE_VALID,
    [14] = 0x1c00000 & ~PTE_VALID,
    [15] = 0x1e00000 & ~PTE_VALID,
    [16] = 0x2000000 & ~PTE_VALID,
    [17] = 0x2200000 & ~PTE_VALID,
    [18] = 0x2400000 & ~PTE_VALID,
    [19] = 0x2600000 & ~PTE_VALID,
    [20] = 0x2800000 & ~PTE_VALID,
    [21] = 0x2a00000 & ~PTE_VALID,
    [22] = 0x2c00000 & ~PTE_VALID,
    [23] = 0x2e00000 & ~PTE_VALID,
    [24] = 0x3000000 & ~PTE_VALID,
    [25] = 0x3200000 & ~PTE_VALID,
    [26] = 0x3400000 & ~PTE_VALID,
    [27] = 0x3600000 & ~PTE_VALID,
    [28] = 0x3800000 & ~PTE_VALID,
    [29] = 0x3a00000 & ~PTE_VALID,
    [30] = 0x3c00000 & ~PTE_VALID,
    [31] = 0x3e00000 & ~PTE_VALID,
    [32] = 0x4000000 & ~PTE_VALID,
    [33] = 0x4200000 & ~PTE_VALID,
    [34] = 0x4400000 & ~PTE_VALID,
    [35] = 0x4600000 & ~PTE_VALID,
    [36] = 0x4800000 & ~PTE_VALID,
    [37] = 0x4a00000 & ~PTE_VALID,
    [38] = 0x4c00000 & ~PTE_VALID,
    [39] = 0x4e00000 & ~PTE_VALID,
    [40] = 0x5000000 & ~PTE_VALID,
    [41] = 0x5200000 & ~PTE_VALID,
    [42] = 0x5400000 & ~PTE_VALID,
    [43] = 0x5600000 & ~PTE_VALID,
    [44] = 0x5800000 & ~PTE_VALID,
    [45] = 0x5a00000 & ~PTE_VALID,
    [46] = 0x5c00000 & ~PTE_VALID,
    [47] = 0x5e00000 & ~PTE_VALID,
    [48] = 0x6000000 & ~PTE_VALID,
    [49] = 0x6200000 & ~PTE_VALID,
    [50] = 0x6400000 & ~PTE_VALID,
    [51] = 0x6600000 & ~PTE_VALID,
    [52] = 0x6800000 & ~PTE_VALID,
    [53] = 0x6a00000 & ~PTE_VALID,
    [54] = 0x6c00000 & ~PTE_VALID,
    [55] = 0x6e00000 & ~PTE_VALID,
    [56] = 0x7000000 & ~PTE_VALID,
    [57] = 0x7200000 & ~PTE_VALID,
    [58] = 0x7400000 & ~PTE_VALID,
    [59] = 0x7600000 & ~PTE_VALID,
    [60] = 0x7800000 & ~PTE_VALID,
    [61] = 0x7a00000 & ~PTE_VALID,
    [62] = 0x7c00000 & ~PTE_VALID,
    [63] = 0x7e00000 & ~PTE_VALID,

    // GIC
    [64] = 0x8000000 | PTE_KERNEL_DEVICE,
    [65] = 0x8200000 | PTE_KERNEL_DEVICE,
    [66] = 0x8400000 | PTE_KERNEL_DEVICE,
    [67] = 0x8600000 | PTE_KERNEL_DEVICE,
    [68] = 0x8800000 | PTE_KERNEL_DEVICE,
    [69] = 0x8a00000 | PTE_KERNEL_DEVICE,
    [70] = 0x8c00000 | PTE_KERNEL_DEVICE,
    [71] = 0x8e00000 | PTE_KERNEL_DEVICE,

    // UART0
    [72] = 0x9000000 | PTE_KERNEL_DEVICE,
    [73] = 0x9200000 | PTE_KERNEL_DEVICE,
    [74] = 0x9400000 | PTE_KERNEL_DEVICE,
    [75] = 0x9600000 | PTE_KERNEL_DEVICE,
    [76] = 0x9800000 | PTE_KERNEL_DEVICE,
    [77] = 0x9a00000 | PTE_KERNEL_DEVICE,
    [78] = 0x9c00000 | PTE_KERNEL_DEVICE,
    [79] = 0x9e00000 | PTE_KERNEL_DEVICE,

    // VIRTIO
    [80] = 0xa000000 | PTE_KERNEL_DEVICE,
    [81] = 0xa200000 | PTE_KERNEL_DEVICE,
    [82] = 0xa400000 | PTE_KERNEL_DEVICE,
    [83] = 0xa600000 | PTE_KERNEL_DEVICE,
    [84] = 0xa800000 | PTE_KERNEL_DEVICE,
    [85] = 0xaa00000 | PTE_KERNEL_DEVICE,
    [86] = 0xac00000 | PTE_KERNEL_DEVICE,
    [87] = 0xae00000 | PTE_KERNEL_DEVICE,

    // not mapped
    // ...

    // E1000 registers
    [128] = 0x10000000 | PTE_KERNEL_DEVICE,
    [129] = 0x10200000 | PTE_KERNEL_DEVICE,
    [130] = 0x10400000 | PTE_KERNEL_DEVICE,
    [131] = 0x10600000 | PTE_KERNEL_DEVICE,
    [132] = 0x10800000 | PTE_KERNEL_DEVICE,
    [133] = 0x10a00000 | PTE_KERNEL_DEVICE,
    [134] = 0x10c00000 | PTE_KERNEL_DEVICE,
    [135] = 0x10e00000 | PTE_KERNEL_DEVICE,
    [136] = 0x11000000 | PTE_KERNEL_DEVICE,
    [137] = 0x11200000 | PTE_KERNEL_DEVICE,
    [138] = 0x11400000 | PTE_KERNEL_DEVICE,
    [139] = 0x11600000 | PTE_KERNEL_DEVICE,
    [140] = 0x11800000 | PTE_KERNEL_DEVICE,
    [141] = 0x11a00000 | PTE_KERNEL_DEVICE,
    [142] = 0x11c00000 | PTE_KERNEL_DEVICE,
    [143] = 0x11e00000 | PTE_KERNEL_DEVICE,
    [144] = 0x12000000 | PTE_KERNEL_DEVICE,
    [145] = 0x12200000 | PTE_KERNEL_DEVICE,
    [146] = 0x12400000 | PTE_KERNEL_DEVICE,
    [147] = 0x12600000 | PTE_KERNEL_DEVICE,
    [148] = 0x12800000 | PTE_KERNEL_DEVICE,
    [149] = 0x12a00000 | PTE_KERNEL_DEVICE,
    [150] = 0x12c00000 | PTE_KERNEL_DEVICE,
    [151] = 0x12e00000 | PTE_KERNEL_DEVICE,
    [152] = 0x13000000 | PTE_KERNEL_DEVICE,
    [153] = 0x13200000 | PTE_KERNEL_DEVICE,
    [154] = 0x13400000 | PTE_KERNEL_DEVICE,
    [155] = 0x13600000 | PTE_KERNEL_DEVICE,
    [156] = 0x13800000 | PTE_KERNEL_DEVICE,
    [157] = 0x13a00000 | PTE_KERNEL_DEVICE,
    [158] = 0x13c00000 | PTE_KERNEL_DEVICE,
    [159] = 0x13e00000 | PTE_KERNEL_DEVICE,
    [160] = 0x14000000 | PTE_KERNEL_DEVICE,
    [161] = 0x14200000 | PTE_KERNEL_DEVICE,
    [162] = 0x14400000 | PTE_KERNEL_DEVICE,
    [163] = 0x14600000 | PTE_KERNEL_DEVICE,
    [164] = 0x14800000 | PTE_KERNEL_DEVICE,
    [165] = 0x14a00000 | PTE_KERNEL_DEVICE,
    [166] = 0x14c00000 | PTE_KERNEL_DEVICE,
    [167] = 0x14e00000 | PTE_KERNEL_DEVICE,
    [168] = 0x15000000 | PTE_KERNEL_DEVICE,
    [169] = 0x15200000 | PTE_KERNEL_DEVICE,
    [170] = 0x15400000 | PTE_KERNEL_DEVICE,
    [171] = 0x15600000 | PTE_KERNEL_DEVICE,
    [172] = 0x15800000 | PTE_KERNEL_DEVICE,
    [173] = 0x15a00000 | PTE_KERNEL_DEVICE,
    [174] = 0x15c00000 | PTE_KERNEL_DEVICE,
    [175] = 0x15e00000 | PTE_KERNEL_DEVICE,
    [176] = 0x16000000 | PTE_KERNEL_DEVICE,
    [177] = 0x16200000 | PTE_KERNEL_DEVICE,
    [178] = 0x16400000 | PTE_KERNEL_DEVICE,
    [179] = 0x16600000 | PTE_KERNEL_DEVICE,
    [180] = 0x16800000 | PTE_KERNEL_DEVICE,
    [181] = 0x16a00000 | PTE_KERNEL_DEVICE,
    [182] = 0x16c00000 | PTE_KERNEL_DEVICE,
    [183] = 0x16e00000 | PTE_KERNEL_DEVICE,
    [184] = 0x17000000 | PTE_KERNEL_DEVICE,
    [185] = 0x17200000 | PTE_KERNEL_DEVICE,
    [186] = 0x17400000 | PTE_KERNEL_DEVICE,
    [187] = 0x17600000 | PTE_KERNEL_DEVICE,
    [188] = 0x17800000 | PTE_KERNEL_DEVICE,
    [189] = 0x17a00000 | PTE_KERNEL_DEVICE,
    [190] = 0x17c00000 | PTE_KERNEL_DEVICE,
    [191] = 0x17e00000 | PTE_KERNEL_DEVICE,
    [192] = 0x18000000 | PTE_KERNEL_DEVICE,
    [193] = 0x18200000 | PTE_KERNEL_DEVICE,
    [194] = 0x18400000 | PTE_KERNEL_DEVICE,
    [195] = 0x18600000 | PTE_KERNEL_DEVICE,
    [196] = 0x18800000 | PTE_KERNEL_DEVICE,
    [197] = 0x18a00000 | PTE_KERNEL_DEVICE,
    [198] = 0x18c00000 | PTE_KERNEL_DEVICE,
    [199] = 0x18e00000 | PTE_KERNEL_DEVICE,
    [200] = 0x19000000 | PTE_KERNEL_DEVICE,
    [201] = 0x19200000 | PTE_KERNEL_DEVICE,
    [202] = 0x19400000 | PTE_KERNEL_DEVICE,
    [203] = 0x19600000 | PTE_KERNEL_DEVICE,
    [204] = 0x19800000 | PTE_KERNEL_DEVICE,
    [205] = 0x19a00000 | PTE_KERNEL_DEVICE,
    [206] = 0x19c00000 | PTE_KERNEL_DEVICE,
    [207] = 0x19e00000 | PTE_KERNEL_DEVICE,
    [208] = 0x1a000000 | PTE_KERNEL_DEVICE,
    [209] = 0x1a200000 | PTE_KERNEL_DEVICE,
    [210] = 0x1a400000 | PTE_KERNEL_DEVICE,
    [211] = 0x1a600000 | PTE_KERNEL_DEVICE,
    [212] = 0x1a800000 | PTE_KERNEL_DEVICE,
    [213] = 0x1aa00000 | PTE_KERNEL_DEVICE,
    [214] = 0x1ac00000 | PTE_KERNEL_DEVICE,
    [215] = 0x1ae00000 | PTE_KERNEL_DEVICE,
    [216] = 0x1b000000 | PTE_KERNEL_DEVICE,
    [217] = 0x1b200000 | PTE_KERNEL_DEVICE,
    [218] = 0x1b400000 | PTE_KERNEL_DEVICE,
    [219] = 0x1b600000 | PTE_KERNEL_DEVICE,
    [220] = 0x1b800000 | PTE_KERNEL_DEVICE,
    [221] = 0x1ba00000 | PTE_KERNEL_DEVICE,
    [222] = 0x1bc00000 | PTE_KERNEL_DEVICE,
    [223] = 0x1be00000 | PTE_KERNEL_DEVICE,
    [224] = 0x1c000000 | PTE_KERNEL_DEVICE,
    [225] = 0x1c200000 | PTE_KERNEL_DEVICE,
    [226] = 0x1c400000 | PTE_KERNEL_DEVICE,
    [227] = 0x1c600000 | PTE_KERNEL_DEVICE,
    [228] = 0x1c800000 | PTE_KERNEL_DEVICE,
    [229] = 0x1ca00000 | PTE_KERNEL_DEVICE,
    [230] = 0x1cc00000 | PTE_KERNEL_DEVICE,
    [231] = 0x1ce00000 | PTE_KERNEL_DEVICE,
    [232] = 0x1d000000 | PTE_KERNEL_DEVICE,
    [233] = 0x1d200000 | PTE_KERNEL_DEVICE,
    [234] = 0x1d400000 | PTE_KERNEL_DEVICE,
    [235] = 0x1d600000 | PTE_KERNEL_DEVICE,
    [236] = 0x1d800000 | PTE_KERNEL_DEVICE,
    [237] = 0x1da00000 | PTE_KERNEL_DEVICE,
    [238] = 0x1dc00000 | PTE_KERNEL_DEVICE,
    [239] = 0x1de00000 | PTE_KERNEL_DEVICE,
    [240] = 0x1e000000 | PTE_KERNEL_DEVICE,
    [241] = 0x1e200000 | PTE_KERNEL_DEVICE,
    [242] = 0x1e400000 | PTE_KERNEL_DEVICE,
    [243] = 0x1e600000 | PTE_KERNEL_DEVICE,
    [244] = 0x1e800000 | PTE_KERNEL_DEVICE,
    [245] = 0x1ea00000 | PTE_KERNEL_DEVICE,
    [246] = 0x1ec00000 | PTE_KERNEL_DEVICE,
    [247] = 0x1ee00000 | PTE_KERNEL_DEVICE,
    [248] = 0x1f000000 | PTE_KERNEL_DEVICE,
    [249] = 0x1f200000 | PTE_KERNEL_DEVICE,
    [250] = 0x1f400000 | PTE_KERNEL_DEVICE,
    [251] = 0x1f600000 | PTE_KERNEL_DEVICE,
    [252] = 0x1f800000 | PTE_KERNEL_DEVICE,
    [253] = 0x1fa00000 | PTE_KERNEL_DEVICE,
    [254] = 0x1fc00000 | PTE_KERNEL_DEVICE,
    [255] = 0x1fe00000 | PTE_KERNEL_DEVICE,
    [256] = 0x20000000 | PTE_KERNEL_DEVICE,
    [257] = 0x20200000 | PTE_KERNEL_DEVICE,
    [258] = 0x20400000 | PTE_KERNEL_DEVICE,
    [259] = 0x20600000 | PTE_KERNEL_DEVICE,
    [260] = 0x20800000 | PTE_KERNEL_DEVICE,
    [261] = 0x20a00000 | PTE_KERNEL_DEVICE,
    [262] = 0x20c00000 | PTE_KERNEL_DEVICE,
    [263] = 0x20e00000 | PTE_KERNEL_DEVICE,
    [264] = 0x21000000 | PTE_KERNEL_DEVICE,
    [265] = 0x21200000 | PTE_KERNEL_DEVICE,
    [266] = 0x21400000 | PTE_KERNEL_DEVICE,
    [267] = 0x21600000 | PTE_KERNEL_DEVICE,
    [268] = 0x21800000 | PTE_KERNEL_DEVICE,
    [269] = 0x21a00000 | PTE_KERNEL_DEVICE,
    [270] = 0x21c00000 | PTE_KERNEL_DEVICE,
    [271] = 0x21e00000 | PTE_KERNEL_DEVICE,
    [272] = 0x22000000 | PTE_KERNEL_DEVICE,
    [273] = 0x22200000 | PTE_KERNEL_DEVICE,
    [274] = 0x22400000 | PTE_KERNEL_DEVICE,
    [275] = 0x22600000 | PTE_KERNEL_DEVICE,
    [276] = 0x22800000 | PTE_KERNEL_DEVICE,
    [277] = 0x22a00000 | PTE_KERNEL_DEVICE,
    [278] = 0x22c00000 | PTE_KERNEL_DEVICE,
    [279] = 0x22e00000 | PTE_KERNEL_DEVICE,
    [280] = 0x23000000 | PTE_KERNEL_DEVICE,
    [281] = 0x23200000 | PTE_KERNEL_DEVICE,
    [282] = 0x23400000 | PTE_KERNEL_DEVICE,
    [283] = 0x23600000 | PTE_KERNEL_DEVICE,
    [284] = 0x23800000 | PTE_KERNEL_DEVICE,
    [285] = 0x23a00000 | PTE_KERNEL_DEVICE,
    [286] = 0x23c00000 | PTE_KERNEL_DEVICE,
    [287] = 0x23e00000 | PTE_KERNEL_DEVICE,
    [288] = 0x24000000 | PTE_KERNEL_DEVICE,
    [289] = 0x24200000 | PTE_KERNEL_DEVICE,
    [290] = 0x24400000 | PTE_KERNEL_DEVICE,
    [291] = 0x24600000 | PTE_KERNEL_DEVICE,
    [292] = 0x24800000 | PTE_KERNEL_DEVICE,
    [293] = 0x24a00000 | PTE_KERNEL_DEVICE,
    [294] = 0x24c00000 | PTE_KERNEL_DEVICE,
    [295] = 0x24e00000 | PTE_KERNEL_DEVICE,
    [296] = 0x25000000 | PTE_KERNEL_DEVICE,
    [297] = 0x25200000 | PTE_KERNEL_DEVICE,
    [298] = 0x25400000 | PTE_KERNEL_DEVICE,
    [299] = 0x25600000 | PTE_KERNEL_DEVICE,
    [300] = 0x25800000 | PTE_KERNEL_DEVICE,
    [301] = 0x25a00000 | PTE_KERNEL_DEVICE,
    [302] = 0x25c00000 | PTE_KERNEL_DEVICE,
    [303] = 0x25e00000 | PTE_KERNEL_DEVICE,
    [304] = 0x26000000 | PTE_KERNEL_DEVICE,
    [305] = 0x26200000 | PTE_KERNEL_DEVICE,
    [306] = 0x26400000 | PTE_KERNEL_DEVICE,
    [307] = 0x26600000 | PTE_KERNEL_DEVICE,
    [308] = 0x26800000 | PTE_KERNEL_DEVICE,
    [309] = 0x26a00000 | PTE_KERNEL_DEVICE,
    [310] = 0x26c00000 | PTE_KERNEL_DEVICE,
    [311] = 0x26e00000 | PTE_KERNEL_DEVICE,
    [312] = 0x27000000 | PTE_KERNEL_DEVICE,
    [313] = 0x27200000 | PTE_KERNEL_DEVICE,
    [314] = 0x27400000 | PTE_KERNEL_DEVICE,
    [315] = 0x27600000 | PTE_KERNEL_DEVICE,
    [316] = 0x27800000 | PTE_KERNEL_DEVICE,
    [317] = 0x27a00000 | PTE_KERNEL_DEVICE,
    [318] = 0x27c00000 | PTE_KERNEL_DEVICE,
    [319] = 0x27e00000 | PTE_KERNEL_DEVICE,
    [320] = 0x28000000 | PTE_KERNEL_DEVICE,
    [321] = 0x28200000 | PTE_KERNEL_DEVICE,
    [322] = 0x28400000 | PTE_KERNEL_DEVICE,
    [323] = 0x28600000 | PTE_KERNEL_DEVICE,
    [324] = 0x28800000 | PTE_KERNEL_DEVICE,
    [325] = 0x28a00000 | PTE_KERNEL_DEVICE,
    [326] = 0x28c00000 | PTE_KERNEL_DEVICE,
    [327] = 0x28e00000 | PTE_KERNEL_DEVICE,
    [328] = 0x29000000 | PTE_KERNEL_DEVICE,
    [329] = 0x29200000 | PTE_KERNEL_DEVICE,
    [330] = 0x29400000 | PTE_KERNEL_DEVICE,
    [331] = 0x29600000 | PTE_KERNEL_DEVICE,
    [332] = 0x29800000 | PTE_KERNEL_DEVICE,
    [333] = 0x29a00000 | PTE_KERNEL_DEVICE,
    [334] = 0x29c00000 | PTE_KERNEL_DEVICE,
    [335] = 0x29e00000 | PTE_KERNEL_DEVICE,
    [336] = 0x2a000000 | PTE_KERNEL_DEVICE,
    [337] = 0x2a200000 | PTE_KERNEL_DEVICE,
    [338] = 0x2a400000 | PTE_KERNEL_DEVICE,
    [339] = 0x2a600000 | PTE_KERNEL_DEVICE,
    [340] = 0x2a800000 | PTE_KERNEL_DEVICE,
    [341] = 0x2aa00000 | PTE_KERNEL_DEVICE,
    [342] = 0x2ac00000 | PTE_KERNEL_DEVICE,
    [343] = 0x2ae00000 | PTE_KERNEL_DEVICE,
    [344] = 0x2b000000 | PTE_KERNEL_DEVICE,
    [345] = 0x2b200000 | PTE_KERNEL_DEVICE,
    [346] = 0x2b400000 | PTE_KERNEL_DEVICE,
    [347] = 0x2b600000 | PTE_KERNEL_DEVICE,
    [348] = 0x2b800000 | PTE_KERNEL_DEVICE,
    [349] = 0x2ba00000 | PTE_KERNEL_DEVICE,
    [350] = 0x2bc00000 | PTE_KERNEL_DEVICE,
    [351] = 0x2be00000 | PTE_KERNEL_DEVICE,
    [352] = 0x2c000000 | PTE_KERNEL_DEVICE,
    [353] = 0x2c200000 | PTE_KERNEL_DEVICE,
    [354] = 0x2c400000 | PTE_KERNEL_DEVICE,
    [355] = 0x2c600000 | PTE_KERNEL_DEVICE,
    [356] = 0x2c800000 | PTE_KERNEL_DEVICE,
    [357] = 0x2ca00000 | PTE_KERNEL_DEVICE,
    [358] = 0x2cc00000 | PTE_KERNEL_DEVICE,
    [359] = 0x2ce00000 | PTE_KERNEL_DEVICE,
    [360] = 0x2d000000 | PTE_KERNEL_DEVICE,
    [361] = 0x2d200000 | PTE_KERNEL_DEVICE,
    [362] = 0x2d400000 | PTE_KERNEL_DEVICE,
    [363] = 0x2d600000 | PTE_KERNEL_DEVICE,
    [364] = 0x2d800000 | PTE_KERNEL_DEVICE,
    [365] = 0x2da00000 | PTE_KERNEL_DEVICE,
    [366] = 0x2dc00000 | PTE_KERNEL_DEVICE,
    [367] = 0x2de00000 | PTE_KERNEL_DEVICE,
    [368] = 0x2e000000 | PTE_KERNEL_DEVICE,
    [369] = 0x2e200000 | PTE_KERNEL_DEVICE,
    [370] = 0x2e400000 | PTE_KERNEL_DEVICE,
    [371] = 0x2e600000 | PTE_KERNEL_DEVICE,
    [372] = 0x2e800000 | PTE_KERNEL_DEVICE,
    [373] = 0x2ea00000 | PTE_KERNEL_DEVICE,
    [374] = 0x2ec00000 | PTE_KERNEL_DEVICE,
    [375] = 0x2ee00000 | PTE_KERNEL_DEVICE,
    [376] = 0x2f000000 | PTE_KERNEL_DEVICE,
    [377] = 0x2f200000 | PTE_KERNEL_DEVICE,
    [378] = 0x2f400000 | PTE_KERNEL_DEVICE,
    [379] = 0x2f600000 | PTE_KERNEL_DEVICE,
    [380] = 0x2f800000 | PTE_KERNEL_DEVICE,
    [381] = 0x2fa00000 | PTE_KERNEL_DEVICE,
    [382] = 0x2fc00000 | PTE_KERNEL_DEVICE,
    [383] = 0x2fe00000 | PTE_KERNEL_DEVICE,
    [384] = 0x30000000 | PTE_KERNEL_DEVICE,
    [385] = 0x30200000 | PTE_KERNEL_DEVICE,
    [386] = 0x30400000 | PTE_KERNEL_DEVICE,
    [387] = 0x30600000 | PTE_KERNEL_DEVICE,
    [388] = 0x30800000 | PTE_KERNEL_DEVICE,
    [389] = 0x30a00000 | PTE_KERNEL_DEVICE,
    [390] = 0x30c00000 | PTE_KERNEL_DEVICE,
    [391] = 0x30e00000 | PTE_KERNEL_DEVICE,
    [392] = 0x31000000 | PTE_KERNEL_DEVICE,
    [393] = 0x31200000 | PTE_KERNEL_DEVICE,
    [394] = 0x31400000 | PTE_KERNEL_DEVICE,
    [395] = 0x31600000 | PTE_KERNEL_DEVICE,
    [396] = 0x31800000 | PTE_KERNEL_DEVICE,
    [397] = 0x31a00000 | PTE_KERNEL_DEVICE,
    [398] = 0x31c00000 | PTE_KERNEL_DEVICE,
    [399] = 0x31e00000 | PTE_KERNEL_DEVICE,
    [400] = 0x32000000 | PTE_KERNEL_DEVICE,
    [401] = 0x32200000 | PTE_KERNEL_DEVICE,
    [402] = 0x32400000 | PTE_KERNEL_DEVICE,
    [403] = 0x32600000 | PTE_KERNEL_DEVICE,
    [404] = 0x32800000 | PTE_KERNEL_DEVICE,
    [405] = 0x32a00000 | PTE_KERNEL_DEVICE,
    [406] = 0x32c00000 | PTE_KERNEL_DEVICE,
    [407] = 0x32e00000 | PTE_KERNEL_DEVICE,
    [408] = 0x33000000 | PTE_KERNEL_DEVICE,
    [409] = 0x33200000 | PTE_KERNEL_DEVICE,
    [410] = 0x33400000 | PTE_KERNEL_DEVICE,
    [411] = 0x33600000 | PTE_KERNEL_DEVICE,
    [412] = 0x33800000 | PTE_KERNEL_DEVICE,
    [413] = 0x33a00000 | PTE_KERNEL_DEVICE,
    [414] = 0x33c00000 | PTE_KERNEL_DEVICE,
    [415] = 0x33e00000 | PTE_KERNEL_DEVICE,
    [416] = 0x34000000 | PTE_KERNEL_DEVICE,
    [417] = 0x34200000 | PTE_KERNEL_DEVICE,
    [418] = 0x34400000 | PTE_KERNEL_DEVICE,
    [419] = 0x34600000 | PTE_KERNEL_DEVICE,
    [420] = 0x34800000 | PTE_KERNEL_DEVICE,
    [421] = 0x34a00000 | PTE_KERNEL_DEVICE,
    [422] = 0x34c00000 | PTE_KERNEL_DEVICE,
    [423] = 0x34e00000 | PTE_KERNEL_DEVICE,
    [424] = 0x35000000 | PTE_KERNEL_DEVICE,
    [425] = 0x35200000 | PTE_KERNEL_DEVICE,
    [426] = 0x35400000 | PTE_KERNEL_DEVICE,
    [427] = 0x35600000 | PTE_KERNEL_DEVICE,
    [428] = 0x35800000 | PTE_KERNEL_DEVICE,
    [429] = 0x35a00000 | PTE_KERNEL_DEVICE,
    [430] = 0x35c00000 | PTE_KERNEL_DEVICE,
    [431] = 0x35e00000 | PTE_KERNEL_DEVICE,
    [432] = 0x36000000 | PTE_KERNEL_DEVICE,
    [433] = 0x36200000 | PTE_KERNEL_DEVICE,
    [434] = 0x36400000 | PTE_KERNEL_DEVICE,
    [435] = 0x36600000 | PTE_KERNEL_DEVICE,
    [436] = 0x36800000 | PTE_KERNEL_DEVICE,
    [437] = 0x36a00000 | PTE_KERNEL_DEVICE,
    [438] = 0x36c00000 | PTE_KERNEL_DEVICE,
    [439] = 0x36e00000 | PTE_KERNEL_DEVICE,
    [440] = 0x37000000 | PTE_KERNEL_DEVICE,
    [441] = 0x37200000 | PTE_KERNEL_DEVICE,
    [442] = 0x37400000 | PTE_KERNEL_DEVICE,
    [443] = 0x37600000 | PTE_KERNEL_DEVICE,
    [444] = 0x37800000 | PTE_KERNEL_DEVICE,
    [445] = 0x37a00000 | PTE_KERNEL_DEVICE,
    [446] = 0x37c00000 | PTE_KERNEL_DEVICE,
    [447] = 0x37e00000 | PTE_KERNEL_DEVICE,
    [448] = 0x38000000 | PTE_KERNEL_DEVICE,
    [449] = 0x38200000 | PTE_KERNEL_DEVICE,
    [450] = 0x38400000 | PTE_KERNEL_DEVICE,
    [451] = 0x38600000 | PTE_KERNEL_DEVICE,
    [452] = 0x38800000 | PTE_KERNEL_DEVICE,
    [453] = 0x38a00000 | PTE_KERNEL_DEVICE,
    [454] = 0x38c00000 | PTE_KERNEL_DEVICE,
    [455] = 0x38e00000 | PTE_KERNEL_DEVICE,
    [456] = 0x39000000 | PTE_KERNEL_DEVICE,
    [457] = 0x39200000 | PTE_KERNEL_DEVICE,
    [458] = 0x39400000 | PTE_KERNEL_DEVICE,
    [459] = 0x39600000 | PTE_KERNEL_DEVICE,
    [460] = 0x39800000 | PTE_KERNEL_DEVICE,
    [461] = 0x39a00000 | PTE_KERNEL_DEVICE,
    [462] = 0x39c00000 | PTE_KERNEL_DEVICE,
    [463] = 0x39e00000 | PTE_KERNEL_DEVICE,
    [464] = 0x3a000000 | PTE_KERNEL_DEVICE,
    [465] = 0x3a200000 | PTE_KERNEL_DEVICE,
    [466] = 0x3a400000 | PTE_KERNEL_DEVICE,
    [467] = 0x3a600000 | PTE_KERNEL_DEVICE,
    [468] = 0x3a800000 | PTE_KERNEL_DEVICE,
    [469] = 0x3aa00000 | PTE_KERNEL_DEVICE,
    [470] = 0x3ac00000 | PTE_KERNEL_DEVICE,
    [471] = 0x3ae00000 | PTE_KERNEL_DEVICE,
    [472] = 0x3b000000 | PTE_KERNEL_DEVICE,
    [473] = 0x3b200000 | PTE_KERNEL_DEVICE,
    [474] = 0x3b400000 | PTE_KERNEL_DEVICE,
    [475] = 0x3b600000 | PTE_KERNEL_DEVICE,
    [476] = 0x3b800000 | PTE_KERNEL_DEVICE,
    [477] = 0x3ba00000 | PTE_KERNEL_DEVICE,
    [478] = 0x3bc00000 | PTE_KERNEL_DEVICE,
    [479] = 0x3be00000 | PTE_KERNEL_DEVICE,
    [480] = 0x3c000000 | PTE_KERNEL_DEVICE,
    [481] = 0x3c200000 | PTE_KERNEL_DEVICE,
    [482] = 0x3c400000 | PTE_KERNEL_DEVICE,
    [483] = 0x3c600000 | PTE_KERNEL_DEVICE,
    [484] = 0x3c800000 | PTE_KERNEL_DEVICE,
    [485] = 0x3ca00000 | PTE_KERNEL_DEVICE,
    [486] = 0x3cc00000 | PTE_KERNEL_DEVICE,
    [487] = 0x3ce00000 | PTE_KERNEL_DEVICE,
    [488] = 0x3d000000 | PTE_KERNEL_DEVICE,
    [489] = 0x3d200000 | PTE_KERNEL_DEVICE,
    [490] = 0x3d400000 | PTE_KERNEL_DEVICE,
    [491] = 0x3d600000 | PTE_KERNEL_DEVICE,
    [492] = 0x3d800000 | PTE_KERNEL_DEVICE,
    [493] = 0x3da00000 | PTE_KERNEL_DEVICE,
    [494] = 0x3dc00000 | PTE_KERNEL_DEVICE,
    [495] = 0x3de00000 | PTE_KERNEL_DEVICE,
    [496] = 0x3e000000 | PTE_KERNEL_DEVICE,
    [497] = 0x3e200000 | PTE_KERNEL_DEVICE,
    [498] = 0x3e400000 | PTE_KERNEL_DEVICE,
    [499] = 0x3e600000 | PTE_KERNEL_DEVICE,
    [500] = 0x3e800000 | PTE_KERNEL_DEVICE,
    [501] = 0x3ea00000 | PTE_KERNEL_DEVICE,
    [502] = 0x3ec00000 | PTE_KERNEL_DEVICE,
    [503] = 0x3ee00000 | PTE_KERNEL_DEVICE,
    [504] = 0x3f000000 | PTE_KERNEL_DEVICE,
    [505] = 0x3f200000 | PTE_KERNEL_DEVICE,
    [506] = 0x3f400000 | PTE_KERNEL_DEVICE,
    [507] = 0x3f600000 | PTE_KERNEL_DEVICE,
    [508] = 0x3f800000 | PTE_KERNEL_DEVICE,
    [509] = 0x3fa00000 | PTE_KERNEL_DEVICE,
    [510] = 0x3fc00000 | PTE_KERNEL_DEVICE,
    [511] = 0x3fe00000 | PTE_KERNEL_DEVICE,
};

/**
 * Bits used to index: 29:21
 * Size per entry: 2MB
 * Address Span: [0x40000000 (1GB), 0x80000000 (2GB)]
 */
__attribute__((__aligned__(PAGE_SIZE))) PTEntries _kernel_pt_lv2_ram = {
    0x40000000 | PTE_KERNEL_DATA, 0x40200000 | PTE_KERNEL_DATA,
    0x40400000 | PTE_KERNEL_DATA, 0x40600000 | PTE_KERNEL_DATA,
    0x40800000 | PTE_KERNEL_DATA, 0x40a00000 | PTE_KERNEL_DATA,
    0x40c00000 | PTE_KERNEL_DATA, 0x40e00000 | PTE_KERNEL_DATA,
    0x41000000 | PTE_KERNEL_DATA, 0x41200000 | PTE_KERNEL_DATA,
    0x41400000 | PTE_KERNEL_DATA, 0x41600000 | PTE_KERNEL_DATA,
    0x41800000 | PTE_KERNEL_DATA, 0x41a00000 | PTE_KERNEL_DATA,
    0x41c00000 | PTE_KERNEL_DATA, 0x41e00000 | PTE_KERNEL_DATA,
    0x42000000 | PTE_KERNEL_DATA, 0x42200000 | PTE_KERNEL_DATA,
    0x42400000 | PTE_KERNEL_DATA, 0x42600000 | PTE_KERNEL_DATA,
    0x42800000 | PTE_KERNEL_DATA, 0x42a00000 | PTE_KERNEL_DATA,
    0x42c00000 | PTE_KERNEL_DATA, 0x42e00000 | PTE_KERNEL_DATA,
    0x43000000 | PTE_KERNEL_DATA, 0x43200000 | PTE_KERNEL_DATA,
    0x43400000 | PTE_KERNEL_DATA, 0x43600000 | PTE_KERNEL_DATA,
    0x43800000 | PTE_KERNEL_DATA, 0x43a00000 | PTE_KERNEL_DATA,
    0x43c00000 | PTE_KERNEL_DATA, 0x43e00000 | PTE_KERNEL_DATA,
    0x44000000 | PTE_KERNEL_DATA, 0x44200000 | PTE_KERNEL_DATA,
    0x44400000 | PTE_KERNEL_DATA, 0x44600000 | PTE_KERNEL_DATA,
    0x44800000 | PTE_KERNEL_DATA, 0x44a00000 | PTE_KERNEL_DATA,
    0x44c00000 | PTE_KERNEL_DATA, 0x44e00000 | PTE_KERNEL_DATA,
    0x45000000 | PTE_KERNEL_DATA, 0x45200000 | PTE_KERNEL_DATA,
    0x45400000 | PTE_KERNEL_DATA, 0x45600000 | PTE_KERNEL_DATA,
    0x45800000 | PTE_KERNEL_DATA, 0x45a00000 | PTE_KERNEL_DATA,
    0x45c00000 | PTE_KERNEL_DATA, 0x45e00000 | PTE_KERNEL_DATA,
    0x46000000 | PTE_KERNEL_DATA, 0x46200000 | PTE_KERNEL_DATA,
    0x46400000 | PTE_KERNEL_DATA, 0x46600000 | PTE_KERNEL_DATA,
    0x46800000 | PTE_KERNEL_DATA, 0x46a00000 | PTE_KERNEL_DATA,
    0x46c00000 | PTE_KERNEL_DATA, 0x46e00000 | PTE_KERNEL_DATA,
    0x47000000 | PTE_KERNEL_DATA, 0x47200000 | PTE_KERNEL_DATA,
    0x47400000 | PTE_KERNEL_DATA, 0x47600000 | PTE_KERNEL_DATA,
    0x47800000 | PTE_KERNEL_DATA, 0x47a00000 | PTE_KERNEL_DATA,
    0x47c00000 | PTE_KERNEL_DATA, 0x47e00000 | PTE_KERNEL_DATA,
    0x48000000 | PTE_KERNEL_DATA, 0x48200000 | PTE_KERNEL_DATA,
    0x48400000 | PTE_KERNEL_DATA, 0x48600000 | PTE_KERNEL_DATA,
    0x48800000 | PTE_KERNEL_DATA, 0x48a00000 | PTE_KERNEL_DATA,
    0x48c00000 | PTE_KERNEL_DATA, 0x48e00000 | PTE_KERNEL_DATA,
    0x49000000 | PTE_KERNEL_DATA, 0x49200000 | PTE_KERNEL_DATA,
    0x49400000 | PTE_KERNEL_DATA, 0x49600000 | PTE_KERNEL_DATA,
    0x49800000 | PTE_KERNEL_DATA, 0x49a00000 | PTE_KERNEL_DATA,
    0x49c00000 | PTE_KERNEL_DATA, 0x49e00000 | PTE_KERNEL_DATA,
    0x4a000000 | PTE_KERNEL_DATA, 0x4a200000 | PTE_KERNEL_DATA,
    0x4a400000 | PTE_KERNEL_DATA, 0x4a600000 | PTE_KERNEL_DATA,
    0x4a800000 | PTE_KERNEL_DATA, 0x4aa00000 | PTE_KERNEL_DATA,
    0x4ac00000 | PTE_KERNEL_DATA, 0x4ae00000 | PTE_KERNEL_DATA,
    0x4b000000 | PTE_KERNEL_DATA, 0x4b200000 | PTE_KERNEL_DATA,
    0x4b400000 | PTE_KERNEL_DATA, 0x4b600000 | PTE_KERNEL_DATA,
    0x4b800000 | PTE_KERNEL_DATA, 0x4ba00000 | PTE_KERNEL_DATA,
    0x4bc00000 | PTE_KERNEL_DATA, 0x4be00000 | PTE_KERNEL_DATA,
    0x4c000000 | PTE_KERNEL_DATA, 0x4c200000 | PTE_KERNEL_DATA,
    0x4c400000 | PTE_KERNEL_DATA, 0x4c600000 | PTE_KERNEL_DATA,
    0x4c800000 | PTE_KERNEL_DATA, 0x4ca00000 | PTE_KERNEL_DATA,
    0x4cc00000 | PTE_KERNEL_DATA, 0x4ce00000 | PTE_KERNEL_DATA,
    0x4d000000 | PTE_KERNEL_DATA, 0x4d200000 | PTE_KERNEL_DATA,
    0x4d400000 | PTE_KERNEL_DATA, 0x4d600000 | PTE_KERNEL_DATA,
    0x4d800000 | PTE_KERNEL_DATA, 0x4da00000 | PTE_KERNEL_DATA,
    0x4dc00000 | PTE_KERNEL_DATA, 0x4de00000 | PTE_KERNEL_DATA,
    0x4e000000 | PTE_KERNEL_DATA, 0x4e200000 | PTE_KERNEL_DATA,
    0x4e400000 | PTE_KERNEL_DATA, 0x4e600000 | PTE_KERNEL_DATA,
    0x4e800000 | PTE_KERNEL_DATA, 0x4ea00000 | PTE_KERNEL_DATA,
    0x4ec00000 | PTE_KERNEL_DATA, 0x4ee00000 | PTE_KERNEL_DATA,
    0x4f000000 | PTE_KERNEL_DATA, 0x4f200000 | PTE_KERNEL_DATA,
    0x4f400000 | PTE_KERNEL_DATA, 0x4f600000 | PTE_KERNEL_DATA,
    0x4f800000 | PTE_KERNEL_DATA, 0x4fa00000 | PTE_KERNEL_DATA,
    0x4fc00000 | PTE_KERNEL_DATA, 0x4fe00000 | PTE_KERNEL_DATA,
    0x50000000 | PTE_KERNEL_DATA, 0x50200000 | PTE_KERNEL_DATA,
    0x50400000 | PTE_KERNEL_DATA, 0x50600000 | PTE_KERNEL_DATA,
    0x50800000 | PTE_KERNEL_DATA, 0x50a00000 | PTE_KERNEL_DATA,
    0x50c00000 | PTE_KERNEL_DATA, 0x50e00000 | PTE_KERNEL_DATA,
    0x51000000 | PTE_KERNEL_DATA, 0x51200000 | PTE_KERNEL_DATA,
    0x51400000 | PTE_KERNEL_DATA, 0x51600000 | PTE_KERNEL_DATA,
    0x51800000 | PTE_KERNEL_DATA, 0x51a00000 | PTE_KERNEL_DATA,
    0x51c00000 | PTE_KERNEL_DATA, 0x51e00000 | PTE_KERNEL_DATA,
    0x52000000 | PTE_KERNEL_DATA, 0x52200000 | PTE_KERNEL_DATA,
    0x52400000 | PTE_KERNEL_DATA, 0x52600000 | PTE_KERNEL_DATA,
    0x52800000 | PTE_KERNEL_DATA, 0x52a00000 | PTE_KERNEL_DATA,
    0x52c00000 | PTE_KERNEL_DATA, 0x52e00000 | PTE_KERNEL_DATA,
    0x53000000 | PTE_KERNEL_DATA, 0x53200000 | PTE_KERNEL_DATA,
    0x53400000 | PTE_KERNEL_DATA, 0x53600000 | PTE_KERNEL_DATA,
    0x53800000 | PTE_KERNEL_DATA, 0x53a00000 | PTE_KERNEL_DATA,
    0x53c00000 | PTE_KERNEL_DATA, 0x53e00000 | PTE_KERNEL_DATA,
    0x54000000 | PTE_KERNEL_DATA, 0x54200000 | PTE_KERNEL_DATA,
    0x54400000 | PTE_KERNEL_DATA, 0x54600000 | PTE_KERNEL_DATA,
    0x54800000 | PTE_KERNEL_DATA, 0x54a00000 | PTE_KERNEL_DATA,
    0x54c00000 | PTE_KERNEL_DATA, 0x54e00000 | PTE_KERNEL_DATA,
    0x55000000 | PTE_KERNEL_DATA, 0x55200000 | PTE_KERNEL_DATA,
    0x55400000 | PTE_KERNEL_DATA, 0x55600000 | PTE_KERNEL_DATA,
    0x55800000 | PTE_KERNEL_DATA, 0x55a00000 | PTE_KERNEL_DATA,
    0x55c00000 | PTE_KERNEL_DATA, 0x55e00000 | PTE_KERNEL_DATA,
    0x56000000 | PTE_KERNEL_DATA, 0x56200000 | PTE_KERNEL_DATA,
    0x56400000 | PTE_KERNEL_DATA, 0x56600000 | PTE_KERNEL_DATA,
    0x56800000 | PTE_KERNEL_DATA, 0x56a00000 | PTE_KERNEL_DATA,
    0x56c00000 | PTE_KERNEL_DATA, 0x56e00000 | PTE_KERNEL_DATA,
    0x57000000 | PTE_KERNEL_DATA, 0x57200000 | PTE_KERNEL_DATA,
    0x57400000 | PTE_KERNEL_DATA, 0x57600000 | PTE_KERNEL_DATA,
    0x57800000 | PTE_KERNEL_DATA, 0x57a00000 | PTE_KERNEL_DATA,
    0x57c00000 | PTE_KERNEL_DATA, 0x57e00000 | PTE_KERNEL_DATA,
    0x58000000 | PTE_KERNEL_DATA, 0x58200000 | PTE_KERNEL_DATA,
    0x58400000 | PTE_KERNEL_DATA, 0x58600000 | PTE_KERNEL_DATA,
    0x58800000 | PTE_KERNEL_DATA, 0x58a00000 | PTE_KERNEL_DATA,
    0x58c00000 | PTE_KERNEL_DATA, 0x58e00000 | PTE_KERNEL_DATA,
    0x59000000 | PTE_KERNEL_DATA, 0x59200000 | PTE_KERNEL_DATA,
    0x59400000 | PTE_KERNEL_DATA, 0x59600000 | PTE_KERNEL_DATA,
    0x59800000 | PTE_KERNEL_DATA, 0x59a00000 | PTE_KERNEL_DATA,
    0x59c00000 | PTE_KERNEL_DATA, 0x59e00000 | PTE_KERNEL_DATA,
    0x5a000000 | PTE_KERNEL_DATA, 0x5a200000 | PTE_KERNEL_DATA,
    0x5a400000 | PTE_KERNEL_DATA, 0x5a600000 | PTE_KERNEL_DATA,
    0x5a800000 | PTE_KERNEL_DATA, 0x5aa00000 | PTE_KERNEL_DATA,
    0x5ac00000 | PTE_KERNEL_DATA, 0x5ae00000 | PTE_KERNEL_DATA,
    0x5b000000 | PTE_KERNEL_DATA, 0x5b200000 | PTE_KERNEL_DATA,
    0x5b400000 | PTE_KERNEL_DATA, 0x5b600000 | PTE_KERNEL_DATA,
    0x5b800000 | PTE_KERNEL_DATA, 0x5ba00000 | PTE_KERNEL_DATA,
    0x5bc00000 | PTE_KERNEL_DATA, 0x5be00000 | PTE_KERNEL_DATA,
    0x5c000000 | PTE_KERNEL_DATA, 0x5c200000 | PTE_KERNEL_DATA,
    0x5c400000 | PTE_KERNEL_DATA, 0x5c600000 | PTE_KERNEL_DATA,
    0x5c800000 | PTE_KERNEL_DATA, 0x5ca00000 | PTE_KERNEL_DATA,
    0x5cc00000 | PTE_KERNEL_DATA, 0x5ce00000 | PTE_KERNEL_DATA,
    0x5d000000 | PTE_KERNEL_DATA, 0x5d200000 | PTE_KERNEL_DATA,
    0x5d400000 | PTE_KERNEL_DATA, 0x5d600000 | PTE_KERNEL_DATA,
    0x5d800000 | PTE_KERNEL_DATA, 0x5da00000 | PTE_KERNEL_DATA,
    0x5dc00000 | PTE_KERNEL_DATA, 0x5de00000 | PTE_KERNEL_DATA,
    0x5e000000 | PTE_KERNEL_DATA, 0x5e200000 | PTE_KERNEL_DATA,
    0x5e400000 | PTE_KERNEL_DATA, 0x5e600000 | PTE_KERNEL_DATA,
    0x5e800000 | PTE_KERNEL_DATA, 0x5ea00000 | PTE_KERNEL_DATA,
    0x5ec00000 | PTE_KERNEL_DATA, 0x5ee00000 | PTE_KERNEL_DATA,
    0x5f000000 | PTE_KERNEL_DATA, 0x5f200000 | PTE_KERNEL_DATA,
    0x5f400000 | PTE_KERNEL_DATA, 0x5f600000 | PTE_KERNEL_DATA,
    0x5f800000 | PTE_KERNEL_DATA, 0x5fa00000 | PTE_KERNEL_DATA,
    0x5fc00000 | PTE_KERNEL_DATA, 0x5fe00000 | PTE_KERNEL_DATA,
    0x60000000 | PTE_KERNEL_DATA, 0x60200000 | PTE_KERNEL_DATA,
    0x60400000 | PTE_KERNEL_DATA, 0x60600000 | PTE_KERNEL_DATA,
    0x60800000 | PTE_KERNEL_DATA, 0x60a00000 | PTE_KERNEL_DATA,
    0x60c00000 | PTE_KERNEL_DATA, 0x60e00000 | PTE_KERNEL_DATA,
    0x61000000 | PTE_KERNEL_DATA, 0x61200000 | PTE_KERNEL_DATA,
    0x61400000 | PTE_KERNEL_DATA, 0x61600000 | PTE_KERNEL_DATA,
    0x61800000 | PTE_KERNEL_DATA, 0x61a00000 | PTE_KERNEL_DATA,
    0x61c00000 | PTE_KERNEL_DATA, 0x61e00000 | PTE_KERNEL_DATA,
    0x62000000 | PTE_KERNEL_DATA, 0x62200000 | PTE_KERNEL_DATA,
    0x62400000 | PTE_KERNEL_DATA, 0x62600000 | PTE_KERNEL_DATA,
    0x62800000 | PTE_KERNEL_DATA, 0x62a00000 | PTE_KERNEL_DATA,
    0x62c00000 | PTE_KERNEL_DATA, 0x62e00000 | PTE_KERNEL_DATA,
    0x63000000 | PTE_KERNEL_DATA, 0x63200000 | PTE_KERNEL_DATA,
    0x63400000 | PTE_KERNEL_DATA, 0x63600000 | PTE_KERNEL_DATA,
    0x63800000 | PTE_KERNEL_DATA, 0x63a00000 | PTE_KERNEL_DATA,
    0x63c00000 | PTE_KERNEL_DATA, 0x63e00000 | PTE_KERNEL_DATA,
    0x64000000 | PTE_KERNEL_DATA, 0x64200000 | PTE_KERNEL_DATA,
    0x64400000 | PTE_KERNEL_DATA, 0x64600000 | PTE_KERNEL_DATA,
    0x64800000 | PTE_KERNEL_DATA, 0x64a00000 | PTE_KERNEL_DATA,
    0x64c00000 | PTE_KERNEL_DATA, 0x64e00000 | PTE_KERNEL_DATA,
    0x65000000 | PTE_KERNEL_DATA, 0x65200000 | PTE_KERNEL_DATA,
    0x65400000 | PTE_KERNEL_DATA, 0x65600000 | PTE_KERNEL_DATA,
    0x65800000 | PTE_KERNEL_DATA, 0x65a00000 | PTE_KERNEL_DATA,
    0x65c00000 | PTE_KERNEL_DATA, 0x65e00000 | PTE_KERNEL_DATA,
    0x66000000 | PTE_KERNEL_DATA, 0x66200000 | PTE_KERNEL_DATA,
    0x66400000 | PTE_KERNEL_DATA, 0x66600000 | PTE_KERNEL_DATA,
    0x66800000 | PTE_KERNEL_DATA, 0x66a00000 | PTE_KERNEL_DATA,
    0x66c00000 | PTE_KERNEL_DATA, 0x66e00000 | PTE_KERNEL_DATA,
    0x67000000 | PTE_KERNEL_DATA, 0x67200000 | PTE_KERNEL_DATA,
    0x67400000 | PTE_KERNEL_DATA, 0x67600000 | PTE_KERNEL_DATA,
    0x67800000 | PTE_KERNEL_DATA, 0x67a00000 | PTE_KERNEL_DATA,
    0x67c00000 | PTE_KERNEL_DATA, 0x67e00000 | PTE_KERNEL_DATA,
    0x68000000 | PTE_KERNEL_DATA, 0x68200000 | PTE_KERNEL_DATA,
    0x68400000 | PTE_KERNEL_DATA, 0x68600000 | PTE_KERNEL_DATA,
    0x68800000 | PTE_KERNEL_DATA, 0x68a00000 | PTE_KERNEL_DATA,
    0x68c00000 | PTE_KERNEL_DATA, 0x68e00000 | PTE_KERNEL_DATA,
    0x69000000 | PTE_KERNEL_DATA, 0x69200000 | PTE_KERNEL_DATA,
    0x69400000 | PTE_KERNEL_DATA, 0x69600000 | PTE_KERNEL_DATA,
    0x69800000 | PTE_KERNEL_DATA, 0x69a00000 | PTE_KERNEL_DATA,
    0x69c00000 | PTE_KERNEL_DATA, 0x69e00000 | PTE_KERNEL_DATA,
    0x6a000000 | PTE_KERNEL_DATA, 0x6a200000 | PTE_KERNEL_DATA,
    0x6a400000 | PTE_KERNEL_DATA, 0x6a600000 | PTE_KERNEL_DATA,
    0x6a800000 | PTE_KERNEL_DATA, 0x6aa00000 | PTE_KERNEL_DATA,
    0x6ac00000 | PTE_KERNEL_DATA, 0x6ae00000 | PTE_KERNEL_DATA,
    0x6b000000 | PTE_KERNEL_DATA, 0x6b200000 | PTE_KERNEL_DATA,
    0x6b400000 | PTE_KERNEL_DATA, 0x6b600000 | PTE_KERNEL_DATA,
    0x6b800000 | PTE_KERNEL_DATA, 0x6ba00000 | PTE_KERNEL_DATA,
    0x6bc00000 | PTE_KERNEL_DATA, 0x6be00000 | PTE_KERNEL_DATA,
    0x6c000000 | PTE_KERNEL_DATA, 0x6c200000 | PTE_KERNEL_DATA,
    0x6c400000 | PTE_KERNEL_DATA, 0x6c600000 | PTE_KERNEL_DATA,
    0x6c800000 | PTE_KERNEL_DATA, 0x6ca00000 | PTE_KERNEL_DATA,
    0x6cc00000 | PTE_KERNEL_DATA, 0x6ce00000 | PTE_KERNEL_DATA,
    0x6d000000 | PTE_KERNEL_DATA, 0x6d200000 | PTE_KERNEL_DATA,
    0x6d400000 | PTE_KERNEL_DATA, 0x6d600000 | PTE_KERNEL_DATA,
    0x6d800000 | PTE_KERNEL_DATA, 0x6da00000 | PTE_KERNEL_DATA,
    0x6dc00000 | PTE_KERNEL_DATA, 0x6de00000 | PTE_KERNEL_DATA,
    0x6e000000 | PTE_KERNEL_DATA, 0x6e200000 | PTE_KERNEL_DATA,
    0x6e400000 | PTE_KERNEL_DATA, 0x6e600000 | PTE_KERNEL_DATA,
    0x6e800000 | PTE_KERNEL_DATA, 0x6ea00000 | PTE_KERNEL_DATA,
    0x6ec00000 | PTE_KERNEL_DATA, 0x6ee00000 | PTE_KERNEL_DATA,
    0x6f000000 | PTE_KERNEL_DATA, 0x6f200000 | PTE_KERNEL_DATA,
    0x6f400000 | PTE_KERNEL_DATA, 0x6f600000 | PTE_KERNEL_DATA,
    0x6f800000 | PTE_KERNEL_DATA, 0x6fa00000 | PTE_KERNEL_DATA,
    0x6fc00000 | PTE_KERNEL_DATA, 0x6fe00000 | PTE_KERNEL_DATA,
    0x70000000 | PTE_KERNEL_DATA, 0x70200000 | PTE_KERNEL_DATA,
    0x70400000 | PTE_KERNEL_DATA, 0x70600000 | PTE_KERNEL_DATA,
    0x70800000 | PTE_KERNEL_DATA, 0x70a00000 | PTE_KERNEL_DATA,
    0x70c00000 | PTE_KERNEL_DATA, 0x70e00000 | PTE_KERNEL_DATA,
    0x71000000 | PTE_KERNEL_DATA, 0x71200000 | PTE_KERNEL_DATA,
    0x71400000 | PTE_KERNEL_DATA, 0x71600000 | PTE_KERNEL_DATA,
    0x71800000 | PTE_KERNEL_DATA, 0x71a00000 | PTE_KERNEL_DATA,
    0x71c00000 | PTE_KERNEL_DATA, 0x71e00000 | PTE_KERNEL_DATA,
    0x72000000 | PTE_KERNEL_DATA, 0x72200000 | PTE_KERNEL_DATA,
    0x72400000 | PTE_KERNEL_DATA, 0x72600000 | PTE_KERNEL_DATA,
    0x72800000 | PTE_KERNEL_DATA, 0x72a00000 | PTE_KERNEL_DATA,
    0x72c00000 | PTE_KERNEL_DATA, 0x72e00000 | PTE_KERNEL_DATA,
    0x73000000 | PTE_KERNEL_DATA, 0x73200000 | PTE_KERNEL_DATA,
    0x73400000 | PTE_KERNEL_DATA, 0x73600000 | PTE_KERNEL_DATA,
    0x73800000 | PTE_KERNEL_DATA, 0x73a00000 | PTE_KERNEL_DATA,
    0x73c00000 | PTE_KERNEL_DATA, 0x73e00000 | PTE_KERNEL_DATA,
    0x74000000 | PTE_KERNEL_DATA, 0x74200000 | PTE_KERNEL_DATA,
    0x74400000 | PTE_KERNEL_DATA, 0x74600000 | PTE_KERNEL_DATA,
    0x74800000 | PTE_KERNEL_DATA, 0x74a00000 | PTE_KERNEL_DATA,
    0x74c00000 | PTE_KERNEL_DATA, 0x74e00000 | PTE_KERNEL_DATA,
    0x75000000 | PTE_KERNEL_DATA, 0x75200000 | PTE_KERNEL_DATA,
    0x75400000 | PTE_KERNEL_DATA, 0x75600000 | PTE_KERNEL_DATA,
    0x75800000 | PTE_KERNEL_DATA, 0x75a00000 | PTE_KERNEL_DATA,
    0x75c00000 | PTE_KERNEL_DATA, 0x75e00000 | PTE_KERNEL_DATA,
    0x76000000 | PTE_KERNEL_DATA, 0x76200000 | PTE_KERNEL_DATA,
    0x76400000 | PTE_KERNEL_DATA, 0x76600000 | PTE_KERNEL_DATA,
    0x76800000 | PTE_KERNEL_DATA, 0x76a00000 | PTE_KERNEL_DATA,
    0x76c00000 | PTE_KERNEL_DATA, 0x76e00000 | PTE_KERNEL_DATA,
    0x77000000 | PTE_KERNEL_DATA, 0x77200000 | PTE_KERNEL_DATA,
    0x77400000 | PTE_KERNEL_DATA, 0x77600000 | PTE_KERNEL_DATA,
    0x77800000 | PTE_KERNEL_DATA, 0x77a00000 | PTE_KERNEL_DATA,
    0x77c00000 | PTE_KERNEL_DATA, 0x77e00000 | PTE_KERNEL_DATA,
    0x78000000 | PTE_KERNEL_DATA, 0x78200000 | PTE_KERNEL_DATA,
    0x78400000 | PTE_KERNEL_DATA, 0x78600000 | PTE_KERNEL_DATA,
    0x78800000 | PTE_KERNEL_DATA, 0x78a00000 | PTE_KERNEL_DATA,
    0x78c00000 | PTE_KERNEL_DATA, 0x78e00000 | PTE_KERNEL_DATA,
    0x79000000 | PTE_KERNEL_DATA, 0x79200000 | PTE_KERNEL_DATA,
    0x79400000 | PTE_KERNEL_DATA, 0x79600000 | PTE_KERNEL_DATA,
    0x79800000 | PTE_KERNEL_DATA, 0x79a00000 | PTE_KERNEL_DATA,
    0x79c00000 | PTE_KERNEL_DATA, 0x79e00000 | PTE_KERNEL_DATA,
    0x7a000000 | PTE_KERNEL_DATA, 0x7a200000 | PTE_KERNEL_DATA,
    0x7a400000 | PTE_KERNEL_DATA, 0x7a600000 | PTE_KERNEL_DATA,
    0x7a800000 | PTE_KERNEL_DATA, 0x7aa00000 | PTE_KERNEL_DATA,
    0x7ac00000 | PTE_KERNEL_DATA, 0x7ae00000 | PTE_KERNEL_DATA,
    0x7b000000 | PTE_KERNEL_DATA, 0x7b200000 | PTE_KERNEL_DATA,
    0x7b400000 | PTE_KERNEL_DATA, 0x7b600000 | PTE_KERNEL_DATA,
    0x7b800000 | PTE_KERNEL_DATA, 0x7ba00000 | PTE_KERNEL_DATA,
    0x7bc00000 | PTE_KERNEL_DATA, 0x7be00000 | PTE_KERNEL_DATA,
    0x7c000000 | PTE_KERNEL_DATA, 0x7c200000 | PTE_KERNEL_DATA,
    0x7c400000 | PTE_KERNEL_DATA, 0x7c600000 | PTE_KERNEL_DATA,
    0x7c800000 | PTE_KERNEL_DATA, 0x7ca00000 | PTE_KERNEL_DATA,
    0x7cc00000 | PTE_KERNEL_DATA, 0x7ce00000 | PTE_KERNEL_DATA,
    0x7d000000 | PTE_KERNEL_DATA, 0x7d200000 | PTE_KERNEL_DATA,
    0x7d400000 | PTE_KERNEL_DATA, 0x7d600000 | PTE_KERNEL_DATA,
    0x7d800000 | PTE_KERNEL_DATA, 0x7da00000 | PTE_KERNEL_DATA,
    0x7dc00000 | PTE_KERNEL_DATA, 0x7de00000 | PTE_KERNEL_DATA,
    0x7e000000 | PTE_KERNEL_DATA, 0x7e200000 | PTE_KERNEL_DATA,
    0x7e400000 | PTE_KERNEL_DATA, 0x7e600000 | PTE_KERNEL_DATA,
    0x7e800000 | PTE_KERNEL_DATA, 0x7ea00000 | PTE_KERNEL_DATA,
    0x7ec00000 | PTE_KERNEL_DATA, 0x7ee00000 | PTE_KERNEL_DATA,
    0x7f000000 | PTE_KERNEL_DATA, 0x7f200000 | PTE_KERNEL_DATA,
    0x7f400000 | PTE_KERNEL_DATA, 0x7f600000 | PTE_KERNEL_DATA,
    0x7f800000 | PTE_KERNEL_DATA, 0x7fa00000 | PTE_KERNEL_DATA,
    0x7fc00000 | PTE_KERNEL_DATA, 0x7fe00000 | PTE_KERNEL_DATA
};

__attribute__((__aligned__(PAGE_SIZE))) PTEntries _kernel_pt_level1 = {
    K2P(_kernel_pt_lv2_dev) + PTE_TABLE,
    K2P(_kernel_pt_lv2_ram) + PTE_TABLE,
};

__attribute__((__aligned__(PAGE_SIZE))) PTEntries kernel_pt_level0 = {
    K2P(_kernel_pt_level1) + PTE_TABLE
};

__attribute__((__aligned__(PAGE_SIZE))) PTEntries invalid_pt = { 0 };